package ar.com.fiuba.domain.impl;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;

import ar.com.fiuba.application.impl.FileDataSource;
import ar.com.fiuba.domain.api.ErrorGenerator;

public class ErrorGeneratorSubstitution extends ErrorGenerator {
	

	public ErrorGeneratorSubstitution(String inputFileName, int numberOfWords)
	{
		super(inputFileName, numberOfWords);
	}
	
	
	public ArrayList<String> generateErrorAtTheBeginning()
	{
		ArrayList<String> wordsWithError = new ArrayList<String>();
		  for(String s:correctWordsArray){		  
			  String aux=s;
			  wordsWithError.add("v" + aux.substring(1,aux.length()));
		  }			  
		  return wordsWithError;
	}
	

	public ArrayList<String> generateErrorAtTheEnd()
	{
		ArrayList<String> wordsWithError = new ArrayList<String>();
		  for(String s:correctWordsArray){		  
			  String aux=s;
			  wordsWithError.add(aux.substring(0,aux.length()-1) + "v");
		  }			  
		  return wordsWithError;
	}
	
	public ArrayList<String> generateErrorInTheMiddle()
	{
		ArrayList<String> wordsWithError = new ArrayList<String>();
		  for(String s:correctWordsArray){		  
			  String aux=s;
			  wordsWithError.add(aux.substring(0,2) + "v" + aux.substring(2,aux.length()));
		  }			  
		  return wordsWithError;
	}
	

}
	
	